package cn.bb.biz;



import cn.bb.dao.PersonDao;
import cn.bb.pojo.Person;

import java.util.List;

public class PersonBizImpl  implements PersonBiz {
    private PersonDao personDao;
    public void setPersonDao(PersonDao personDao) {
        this.personDao = personDao;
    }
    @Override
    public void addPersons(List<Person> personList) {
        if(personList != null){
            for (Person person : personList) {
                personDao.addPerson(person);
            }
        }
    }

    @Override
    public void addPerso(Person person) {
        personDao.addPerson(person);
    }

    @Override
    public void delPerson(int id) {
        personDao.delPerson(id);
    }

    @Override
    public void updatePerson(Person person) {
        personDao.updatePerson(person);
    }

    @Override
    public Person gets(int id) {
        return personDao.get(id);
    }

    @Override
    public List<Person> search(Person person) {
        return personDao.searchPerson(person);
    }

    @Override
    public List<Person> search(String hql) {
        return personDao.searchPerson(hql);
    }
}
